## Pre-defined animation.
##
##class DefAnimTransRot():
import animation
from keyframe import PosKeyFrame, RotKeyFrame

def anim_TransRot(firstFrame, lastFrame, nFrames):
    #self.firstFrame = firstFrame
    #self.lastFrame = lastFrame
    #self.nframes = nframes
    anim = animation.Animation ([PosKeyFrame (firstFrame, [0,0,0]),
                         PosKeyFrame (nFrames/2, [1,0,0]),
                         PosKeyFrame (lastFrame, [0,1,0]),
                         RotKeyFrame (firstFrame, [1,1,1,0]),
                         RotKeyFrame (50, [1,1,1,180])])
    interptrans = anim.interpolate (nFrames, firstFrame)

    return anim, interptrans
